package com.ruibang.glass.sale.constant;

/**
 * @author 宋锦康
 */
public enum SaleErrorCode {

    PARAM_ERROR(100070001, "错误信息"),
    BUSINESS_MENU_IS_EMPTY(100040011, "业务菜单ID不能为空"),
    BCP_CP_OUT_BOUND_NO_PRODUCT(100040012, "物品申请发货！发货物品为空 请检查商品"),
    NO_QUALITY(100040013, "新增物品数量为0 ！请检查商品"),
    RETURN_CHANGE_PRODUCT_NULL(100040014, "退货数量为空 ！请检查商品"),
    SHIPPING_NULL_ATYPE(100040099, "发货数据水平架为空！请检查水平架数据"),
    SALE_RETURN_NO_PRODUCT(100040015, "退换货产品为空 请重新检查"),
    SALE_CONTRACT_NO_QUALITY(100040016, "合同新增物品为空"),
    SALE_CONTRACT_IS_NO_START(100040022, "合同状态不属于新建状态！请重新选择删除数据"),
    ORDER_NO_SHIPPING(100040020, "订单暂未全部发完！ 请稍后再试"),
    ORDER_QUALITY_MORE_CONTRACT_QUALITY(100040017, "新增订单数量大于合同数量 ！请修改订单数量"),
    CONTRACT_NO_QUALITY(100040019, "合同关联物品暂无数量"),
    SHIPPING_NO_ITEM(100040044, "发货暂无数据！请点击添加一行！添加发货数据"),
    NEW_ORDER_NO_ITEM(100040018, "新增订单没有物料信息 ！请添加物料信息"),
    UNION_ORDER_MORE_ORDER(100040055, "新增订单关联多发货订单！多发货订单数量大于新增订单数"),
    NO_DISPUTE_ITEM(100040021, "销售异议单退货产品为空！请检查退货产品数据"),
    SAME_A_TYPE(100040033, "列表中存在相同的托盘号！请检查托盘号"),
    SAME_A_TYPE_DELETE(100040034, "列表中存在相同的托盘号！请删除一条相同的托盘数据"),
    ;



    private int code;
    private String msg;

    SaleErrorCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getMsg() {
        return msg;
    }

    public int getCode() {
        return code;
    }

    public static String getValue(int code) {
        for (SaleErrorCode ele : values()) {
            if (ele.getCode() == code) return ele.getMsg();
        }
        return null;
    }

}
